package a.g;

import a.c.e;
import a.c.w;
import a.c.x;
import a.f.t;
import a.h.*;
import a.h.z;
import a.j.g;
import a.j.ke;

import java.awt.*;

public class eb
  extends h
{
  private static final String q = "ACTIVATE_DETERMINISTIC_MODE";
  private static final String r = "VISUAL";
  private static final String s = "ALGORITHM";
  private static final String t = "COMPACTNESS";
  private static final String u = "USE_AUTOMATIC_GROUP_NODE_COMPACTION";
  private static final String v = "GROUP_COMPACTNESS";
  private static final String w = "MAXIMAL_DURATION";
  private static final String x = "OBEY_NODE_SIZES";
  private static final String y = "CONSIDER_NODE_LABELS";
  private static final String z = "ALLOW_NODE_OVERLAPS";
  private static final String A = "MINIMAL_NODE_DISTANCE";
  private static final String B = "SCOPE";
  private static final String C = "PREFERRED_EDGE_LENGTH";
  private static final String D = "SMARTORGANIC";
  private static final String E = "SUBSET";
  private static final String F = "MAINLY_SUBSET";
  private static final String G = "ALL";
  private static final String H = "QUALITY_TIME_RATIO";
  private static final String I = "RESTRICT_OUTPUT";
  private static final String J = "NONE";
  private static final String K = "OUTPUT_CAGE";
  private static final String L = "OUTPUT_CIRCULAR_CAGE";
  private static final String M = "OUTPUT_ELLIPTICAL_CAGE";
  private static final String N = "OUTPUT_AR";
  private static final String O = "CAGE_X";
  private static final String P = "CAGE_Y";
  private static final String Q = "CAGE_WIDTH";
  private static final String R = "CAGE_HEIGHT";
  private static final String S = "ELLIPTICAL_CAGE_X";
  private static final String T = "ELLIPTICAL_CAGE_Y";
  private static final String U = "ELLIPTICAL_CAGE_WIDTH";
  private static final String V = "ELLIPTICAL_CAGE_HEIGHT";
  private static final String W = "CAGE_CENTER_X";
  private static final String X = "CAGE_CENTER_Y";
  private static final String Y = "CAGE_RADIUS";
  private static final String Z = "CAGE_RATIO";
  private static final String ab = "AR_CAGE_USE_VIEW";
  private static final String bb = "RECT_CAGE_USE_VIEW";
  private static final String cb = "CIRC_CAGE_USE_VIEW";
  private static final String db = "ELL_CAGE_USE_VIEW";
  private static final String eb = "RESTRICTIONS";
  private static final String fb = "AVOID_NODE_EDGE_OVERLAPS";
  private static final String gb = "GROUPING";
  private static final String hb = "GROUP_LAYOUT_POLICY";
  private static final String ib = "IGNORE_GROUPS";
  private static final String jb = "LAYOUT_GROUPS";
  private static final String kb = "FIX_GROUP_BOUNDS";
  private static final String lb = "FIX_GROUP_CONTENTS";
  private static final String mb = "USE_AUTO_CLUSTERING";
  private static final String nb = "AUTO_CLUSTERING_QUALITY";
  private static final String[] ob = { "ALL", "MAINLY_SUBSET", "SUBSET" };
  private final String[] pb = { "LAYOUT_GROUPS", "FIX_GROUP_CONTENTS", "FIX_GROUP_BOUNDS", "IGNORE_GROUPS" };
  private static final String[] qb = { "NONE", "OUTPUT_CAGE", "OUTPUT_CIRCULAR_CAGE", "OUTPUT_AR", "OUTPUT_ELLIPTICAL_CAGE" };
  private a.f.g.f rb;
  public static boolean sb;
  
  public eb()
  {
    super("SMARTORGANIC", "yWorks Graph Layout Team", "Wrapper for SmartOrganicLayouter");
    d(true);
  }
  
  protected dc j()
  {
    int i = f.p;
    boolean bool = f.o;
    z();
    dc localdc = new dc(a());
    z localz = new z(localdc);
    localdc.l("VISUAL");
    localdc.a("SCOPE", ob, this.rb.I());
    localdc.a("PREFERRED_EDGE_LENGTH", (int)this.rb.K(), 5, 500);
    localdc.a("CONSIDER_NODE_LABELS", this.rb.v());
    localdc.a("ALLOW_NODE_OVERLAPS", this.rb.Q());
    z.t_ localt_ = localz.a("ALLOW_NODE_OVERLAPS", Boolean.FALSE).a(localz.a("CONSIDER_NODE_LABELS", Boolean.TRUE));
    localz.a(localt_, localdc.a("MINIMAL_NODE_DISTANCE", this.rb.P(), 0.0D, 100.0D, 0));
    localdc.a("AVOID_NODE_EDGE_OVERLAPS", false);
    localz.a("CONSIDER_NODE_LABELS", Boolean.FALSE, "ALLOW_NODE_OVERLAPS");
    localdc.a("COMPACTNESS", this.rb.J(), 0.0D, 1.0D);
    localdc.a("USE_AUTO_CLUSTERING", this.rb.t());
    localdc.a("AUTO_CLUSTERING_QUALITY", this.rb.u(), 0.0D, 1.0D);
    localz.a("USE_AUTO_CLUSTERING", Boolean.TRUE, "AUTO_CLUSTERING_QUALITY");
    localdc.l("RESTRICTIONS");
    Object localObject = new Object();
    localdc.a("RESTRICT_OUTPUT", qb, 0).a(gb.d, localObject);
    cc localcc = new cc();
    localz.a("RESTRICT_OUTPUT", "OUTPUT_CAGE", localcc);
    localcc.a("OptionGroup.title", "OUTPUT_CAGE");
    localcc.a(gb.d, localObject);
    localcc.a(gb.f, "OUTPUT_CAGE");
    localcc.a(localdc.a("RECT_CAGE_USE_VIEW", true));
    localt_ = localz.a("RESTRICT_OUTPUT", "OUTPUT_CAGE").b(localz.a("RECT_CAGE_USE_VIEW", Boolean.FALSE));
    localz.a(localt_, localcc.a(localdc.a("CAGE_X", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("CAGE_Y", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("CAGE_WIDTH", 1000.0D)));
    localdc.j("RESTRICTIONS", "CAGE_WIDTH").a(jc.y, new Double(4.9E-324D));
    localz.a(localt_, localcc.a(localdc.a("CAGE_HEIGHT", 1000.0D)));
    localdc.j("RESTRICTIONS", "CAGE_HEIGHT").a(jc.y, new Double(4.9E-324D));
    localcc = new cc();
    localz.a("RESTRICT_OUTPUT", "OUTPUT_CIRCULAR_CAGE", localcc);
    localcc.a("OptionGroup.title", "OUTPUT_CIRCULAR_CAGE");
    localcc.a(gb.d, localObject);
    localcc.a(gb.f, "OUTPUT_CIRCULAR_CAGE");
    localcc.a(localdc.a("CIRC_CAGE_USE_VIEW", true));
    localt_ = localz.a("RESTRICT_OUTPUT", "OUTPUT_CIRCULAR_CAGE").b(localz.a("CIRC_CAGE_USE_VIEW", Boolean.FALSE));
    localz.a(localt_, localcc.a(localdc.a("CAGE_CENTER_X", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("CAGE_CENTER_Y", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("CAGE_RADIUS", 1000.0D)));
    localdc.j("RESTRICTIONS", "CAGE_RADIUS").a(jc.y, new Double(4.9E-324D));
    localcc = new cc();
    localz.a("RESTRICT_OUTPUT", "OUTPUT_ELLIPTICAL_CAGE", localcc);
    localcc.a("OptionGroup.title", "OUTPUT_ELLIPTICAL_CAGE");
    localcc.a(gb.d, localObject);
    localcc.a(gb.f, "OUTPUT_ELLIPTICAL_CAGE");
    localcc.a(localdc.a("ELL_CAGE_USE_VIEW", true));
    localt_ = localz.a("RESTRICT_OUTPUT", "OUTPUT_ELLIPTICAL_CAGE").b(localz.a("ELL_CAGE_USE_VIEW", Boolean.FALSE));
    localz.a(localt_, localcc.a(localdc.a("ELLIPTICAL_CAGE_X", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("ELLIPTICAL_CAGE_Y", 0.0D)));
    localz.a(localt_, localcc.a(localdc.a("ELLIPTICAL_CAGE_WIDTH", 1000.0D)));
    localdc.j("RESTRICTIONS", "ELLIPTICAL_CAGE_WIDTH").a(jc.y, new Double(4.9E-324D));
    localz.a(localt_, localcc.a(localdc.a("ELLIPTICAL_CAGE_HEIGHT", 1000.0D)));
    localdc.j("RESTRICTIONS", "ELLIPTICAL_CAGE_HEIGHT").a(jc.y, new Double(4.9E-324D));
    localcc = new cc();
    localz.a("RESTRICT_OUTPUT", "OUTPUT_AR", localcc);
    localcc.a("OptionGroup.title", "OUTPUT_AR");
    localcc.a(gb.d, localObject);
    localcc.a(gb.f, "OUTPUT_AR");
    localcc.a(localdc.a("AR_CAGE_USE_VIEW", true));
    localt_ = localz.a("RESTRICT_OUTPUT", "OUTPUT_AR").b(localz.a("AR_CAGE_USE_VIEW", Boolean.FALSE));
    localz.a(localt_, localcc.a(localdc.a("CAGE_RATIO", 1.0D)));
    localdc.l("GROUPING");
    localdc.a("GROUP_LAYOUT_POLICY", this.pb, 0);
    localdc.a("USE_AUTOMATIC_GROUP_NODE_COMPACTION", this.rb.s());
    localdc.a("GROUP_COMPACTNESS", this.rb.a(), 0.0D, 1.0D);
    localz.a("USE_AUTOMATIC_GROUP_NODE_COMPACTION", Boolean.FALSE, "GROUP_COMPACTNESS");
    localdc.l("ALGORITHM");
    a.h.ec localec = localdc.a("QUALITY_TIME_RATIO", this.rb.G(), 0.0D, 1.0D);
    localec.a(gb.h, "SPEED");
    localec.a(gb.g, "QUALITY");
    localdc.a("MAXIMAL_DURATION", (int)(this.rb.H() / 1000L)).a(nc.y, new Integer(0));
    localdc.a("ACTIVATE_DETERMINISTIC_MODE", this.rb.O());
    if ((i != 0) || (bool))
    {
      if (i == 0) {}
      q.n = !q.n;
    }
    if (i != 0) {
      q.o = !q.o;
    }
    return localdc;
  }
  
  protected void m()
  {
    int i = f.p;
    boolean bool2 = f.o;
    z();
    dc localdc = i();
    this.rb.e(localdc.c("VISUAL", "PREFERRED_EDGE_LENGTH"));
    boolean bool1 = localdc.e("VISUAL", "CONSIDER_NODE_LABELS");
    this.rb.j(bool1);
    if ((i != 0) || (localdc.e("VISUAL", "ALLOW_NODE_OVERLAPS"))) {
      if (i != 0) {}
    }
    this.rb.o(!bool1);
    this.rb.g(localdc.d("VISUAL", "MINIMAL_NODE_DISTANCE"));
    this.rb.b(dc.a(ob, localdc.f("VISUAL", "SCOPE")));
    this.rb.d(localdc.d("VISUAL", "COMPACTNESS"));
    this.rb.h(localdc.g("USE_AUTOMATIC_GROUP_NODE_COMPACTION"));
    this.rb.a(localdc.f("GROUP_COMPACTNESS"));
    this.rb.m(true);
    this.rb.i(localdc.g("USE_AUTO_CLUSTERING"));
    this.rb.b(localdc.f("AUTO_CLUSTERING_QUALITY"));
    this.rb.l(localdc.g("AVOID_NODE_EDGE_OVERLAPS"));
    this.rb.n(localdc.e("ALGORITHM", "ACTIVATE_DETERMINISTIC_MODE"));
    this.rb.a(1000 * localdc.c("ALGORITHM", "MAXIMAL_DURATION"));
    this.rb.c(localdc.d("ALGORITHM", "QUALITY_TIME_RATIO"));
    if (i == 0) {}
    Rectangle localRectangle3;
    double d1;
    double d2;
    double d4;
    switch (localdc.i("RESTRICT_OUTPUT"))
    {
    case 0: 
      this.rb.e(true);
      this.rb.a(a.f.g.j.a);
      if (i == 0) {
        if (!bool2) {
          return;
        }
      }
    case 1: 
      if (i == 0) {
        if (localdc.g("RECT_CAGE_USE_VIEW")) {
          if ((i != 0) || (g() != null))
          {
            localRectangle3 = g().getVisibleRect();
            d1 = localRectangle3.x;
            d2 = localRectangle3.y;
            d4 = localRectangle3.width;
            d5 = localRectangle3.height;
            if (i != 0) {
              break label470;
            }
            if (!bool2) {
              break label443;
            }
          }
        }
      }
      d1 = localdc.f("CAGE_X");
      d2 = localdc.f("CAGE_Y");
      d4 = localdc.f("CAGE_WIDTH");
      double d5 = localdc.f("CAGE_HEIGHT");
      this.rb.a(a.f.g.j.a(d1, d2, d4, d5));
      this.rb.e(false);
      if (i == 0) {
        if (!bool2) {
          return;
        }
      }
    case 2: 
      if (i == 0) {
        if (localdc.g("CIRC_CAGE_USE_VIEW")) {
          if ((i != 0) || (g() != null))
          {
            Rectangle localRectangle2 = g().getVisibleRect();
            d1 = localRectangle2.getCenterX();
            d2 = localRectangle2.getCenterY();
            d4 = Math.min(localRectangle2.width, localRectangle2.height) * 0.5D;
            if (i != 0) {
              break label604;
            }
            if (!bool2) {
              break label579;
            }
          }
        }
      }
      d1 = localdc.f("CAGE_CENTER_X");
      d2 = localdc.f("CAGE_CENTER_Y");
      d4 = localdc.f("CAGE_RADIUS");
      this.rb.a(a.f.g.j.a(d1, d2, d4));
      this.rb.e(false);
      if (i == 0) {
        if (!bool2) {
          return;
        }
      }
    case 3: 
      if (i == 0) {
        if (localdc.g("AR_CAGE_USE_VIEW")) {
          if ((i != 0) || (g() != null))
          {
            Rectangle localRectangle1 = g().getVisibleRect();
            d1 = localRectangle1.getWidth() / localRectangle1.getHeight();
            if (i != 0) {
              break label718;
            }
            if (!bool2) {
              break label676;
            }
          }
        }
      }
      d1 = localdc.f("CAGE_RATIO");
      this.rb.a(a.f.g.j.a(d1));
      this.rb.e(true);
      ((t)this.rb.e()).a(d1 * 100.0D, 100.0D);
      if (i == 0) {
        if (!bool2) {
          return;
        }
      }
    case 4: 
      label443:
      label470:
      label604:
      if (i == 0) {
        if (localdc.g("ELL_CAGE_USE_VIEW")) {
          if ((i != 0) || (g() != null))
          {
            localRectangle3 = g().getVisibleRect();
            d1 = localRectangle3.x;
            d3 = localRectangle3.y;
            d4 = localRectangle3.width;
            d6 = localRectangle3.height;
            if (i != 0) {
              break label850;
            }
            if (!bool2) {
              break label833;
            }
          }
        }
      }
      label579:
      label718:
      d1 = localdc.f("ELLIPTICAL_CAGE_X");
      label676:
      double d3 = localdc.f("ELLIPTICAL_CAGE_Y");
      d4 = localdc.f("ELLIPTICAL_CAGE_WIDTH");
      double d6 = localdc.f("ELLIPTICAL_CAGE_HEIGHT");
      label833:
      this.rb.a(a.f.g.j.b(d1, d3, d4, d6));
      label850:
      this.rb.e(false);
    }
  }
  
  protected void n()
  {
    int j = f.p;
    boolean bool2 = f.o;
    dc localdc = i();
    int i = localdc.i("GROUP_LAYOUT_POLICY");
    z();
    g localg = e();
    try
    {
      if ((j != 0) || (i != 3)) {
        if (j != 0) {}
      }
      boolean bool1 = a.j.a.j.d(localg);
      r().b(bool1);
      x localx;
      w localw;
      e locale;
      if (j == 0) {
        if (i == 2)
        {
          if (j != 0) {
            break label195;
          }
          if (bool1)
          {
            localx = db.a();
            localw = localg.v();
            do
            {
              if (!localw.e()) {
                break;
              }
              locale = localw.d();
              if (j != 0) {
                break label184;
              }
              if (bool2) {
                break label176;
              }
              if (j == 0)
              {
                if (a.j.a.j.a(localg).m(locale)) {
                  localx.a(locale, a.f.g.f.F);
                }
                localw.f();
              }
            } while (!bool2);
            if (j == 0) {
              label176:
              localg.a(a.f.g.f.D, localx);
            }
            label184:
            if (j != 0) {
              break label318;
            }
          }
        }
      }
      label195:
      if ((bool2) && ((j != 0) || (i == 1))) {
        if (bool1)
        {
          localx = db.a();
          localw = localg.v();
          do
          {
            if (!localw.e()) {
              break;
            }
            locale = localw.d();
            if (bool2) {
              break label291;
            }
            if (j == 0)
            {
              if (a.j.a.j.a(localg).m(locale)) {
                localx.a(locale, a.f.g.f.G);
              }
              localw.f();
            }
          } while (!bool2);
          if (j != 0) {
            break label318;
          }
          localg.a(a.f.g.f.D, localx);
        }
      }
      label291:
      localg.a(a.f.g.f.C, ke.c(localg));
      a(this.rb);
    }
    finally
    {
      label318:
      if (j == 0)
      {
        localg.j(a.f.g.f.C);
        if ((i != 2) && (i != 1)) {}
      }
      else
      {
        localg.j(a.f.g.f.D);
      }
      r().b(true);
    }
  }
  
  protected void o()
  {
    this.rb = null;
  }
  
  private void z()
  {
    if ((f.p != 0) || (this.rb == null)) {
      this.rb = new a.f.g.f();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.eb

 * JD-Core Version:    0.7.0.1

 */